package com.rslai.base.tool.servertest.database.mysql;

import com.rslai.base.tool.servertest.database.QunitDataTypeFactory;
import com.rslai.base.tool.servertest.database.datatype.BitDataType;
import org.dbunit.dataset.datatype.DataType;
import org.dbunit.dataset.datatype.DataTypeException;

public class MysqlDataTypeFactory extends QunitDataTypeFactory
{
    public DataType createDataType(int sqlType, String sqlTypeName)
            throws DataTypeException
    {
        if (sqlType != 1111) {
            if ("BIT".equals(sqlTypeName)) {
                return BitDataType.TYPE;
            }
            if ("INT UNSIGNED".equals(sqlTypeName)) {
                return DataType.BIGINT;
            }
            return super.createDataType(sqlType, sqlTypeName);
        }
        return super.createDataType(sqlType, sqlTypeName);
    }
}
